﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WarOfDev.Web.ViewModels;
using WarOfDev.EF;
using WarOfDev.Core.Common;

namespace WarOfDev.Web.Models.MappingToViewModel
{
    public static class TaskMapping
    {
        public static TaskViewModel ToViewModel(this Task task)
        {
            TaskViewModel vm = new TaskViewModel();
            vm.Id = task.Id;
            vm.Title = task.Title;
            vm.ExperienceValue = task.ExperienceValue;
            vm.Status = task.Status;
            vm.StatusName = ((EnumTaskStatus)task.Status).GetEnumDescription();
            return vm;
        }
    }
}